import request from "@/utils/request";
import { IBaseQueryParams, IQueryParams, ITableListItem } from "./data";

export async function queryList(params?: IBaseQueryParams<IQueryParams>): Promise<any> {
	return request({
		url: "/employees/page",
		method: "post",
		data: params,
	});
}

export async function update(param: ITableListItem): Promise<any> {
	return request({
		url: "/employees/",
		data: param,
		method: "put",
	});
}

export async function save(param: ITableListItem): Promise<any> {
	return request({
		url: "/employees/register",
		data: param,
		method: "post",
	});
}

export async function removeData(id: number): Promise<any> {
	return request({
		url: `/employees/${id}`,
		method: "delete",
	});
}
